package com.tianji.learning.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tianji.common.domain.dto.PageDTO;
import com.tianji.common.domain.query.PageQuery;
import com.tianji.learning.domain.po.LearningLesson;
import com.tianji.learning.domain.vo.LearningLessonVO;
import com.tianji.learning.domain.vo.LearningPlanPageVO;

import java.util.List;

/**
 * <p>
 * 学生课程表 服务类
 * </p>
 *
 * @author author
 * @since 2024-12-07
 */
public interface ILearningLessonService extends IService<LearningLesson> {

    /**
     * 添加用户课程表--监听支付成功
     * @param userId 用户id
     * @param courseIds 课程id集合
     */
    void addUserLessons(Long userId, List<Long> courseIds);

    /**
     * 分页查询课程表
     * @param pageQuery
     * @return
     */
    PageDTO<LearningLessonVO> queryLessonPage(PageQuery pageQuery);

    /**
     * 查询正在学习的课程信息
     * @return
     */
    LearningLessonVO queryNowLesson();

    /**
     * 根据课程id删除课程表记录
     * @param courseId
     */
    void removeByCourseId(Long courseId);

    /**
     * 判断课程是否过期
     * @param courseId
     * @return
     */
    Long isLessonValid(Long courseId);

    /**
     * 查询课程状态
     * @param courseId
     * @return
     */
    LearningLessonVO queryStatusByCourseId(Long courseId);

    /**
     * 查询课程学习人数
     * @param courseId
     * @return
     */
    Integer countLearningLessonByCourse(Long courseId);

    /**
     * 创建学习计划
     *
     */
    void createPlan(Long courseId, Integer freq);

    /**
     * 学习计划的分页查询
     * @param pageQuery
     * @return
     */
    LearningPlanPageVO queryPlanPage(PageQuery pageQuery);
}
